/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package escr.persistencia;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Aditardo
 */
@Entity
@Table(name = "turno")
@NamedQueries({@NamedQuery(name = "Turno.findByTurCodigo", query = "SELECT t FROM Turno t WHERE t.turCodigo = :turCodigo"), @NamedQuery(name = "Turno.findByTurFecha", query = "SELECT t FROM Turno t WHERE t.turFecha = :turFecha"), @NamedQuery(name = "Turno.findByTurHora", query = "SELECT t FROM Turno t WHERE t.turHora = :turHora"), @NamedQuery(name = "Turno.findByTurCita", query = "SELECT t FROM Turno t WHERE t.turCita = :turCita"), @NamedQuery(name = "Turno.findByTurValor", query = "SELECT t FROM Turno t WHERE t.turValor = :turValor"), @NamedQuery(name = "Turno.findByTurResponsable", query = "SELECT t FROM Turno t WHERE t.turResponsable = :turResponsable"), @NamedQuery(name = "Turno.findByTurDa1", query = "SELECT t FROM Turno t WHERE t.turDa1 = :turDa1"), @NamedQuery(name = "Turno.findByTurDa2", query = "SELECT t FROM Turno t WHERE t.turDa2 = :turDa2"), @NamedQuery(name = "Turno.findByTurN", query = "SELECT t FROM Turno t WHERE t.turN = :turN"), @NamedQuery(name = "Turno.findByTurHorario", query = "SELECT t FROM Turno t WHERE t.turHorario = :turHorario")})
public class Turno implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "TUR_CODIGO", nullable = false)
    private Integer turCodigo;
    @Column(name = "TUR_FECHA")
    @Temporal(TemporalType.DATE)
    private Date turFecha;
    @Column(name = "TUR_HORA")
    private String turHora;
    @Column(name = "TUR_CITA")
    @Temporal(TemporalType.DATE)
    private Date turCita;
    @Column(name = "TUR_VALOR")
    private Integer turValor;
    @Column(name = "TUR_RESPONSABLE")
    private String turResponsable;
    @Column(name = "TUR_DA1")
    private Integer turDa1;
    @Column(name = "TUR_DA2")
    private Integer turDa2;
    @Column(name = "TUR_N")
    private Integer turN;
    @Column(name = "TUR_HORARIO")
    private String turHorario;
    @JoinColumn(name = "PRE_COD", referencedColumnName = "PRE_COD")
    @ManyToOne
    private ProEspe preCod;
    @JoinColumn(name = "PAC_CODIGO", referencedColumnName = "PAC_CODIGO")
    @ManyToOne
    private Paciente pacCodigo;
    @OneToMany(mappedBy = "turCodigo")
    private Collection<Diagnostico> diagnosticoCollection;

    public Turno() {
    }

    public Turno(Integer turCodigo) {
        this.turCodigo = turCodigo;
    }

    public Integer getTurCodigo() {
        return turCodigo;
    }

    public void setTurCodigo(Integer turCodigo) {
        this.turCodigo = turCodigo;
    }

    public Date getTurFecha() {
        return turFecha;
    }

    public void setTurFecha(Date turFecha) {
        this.turFecha = turFecha;
    }

    public String getTurHora() {
        return turHora;
    }

    public void setTurHora(String turHora) {
        this.turHora = turHora;
    }

    public Date getTurCita() {
        return turCita;
    }

    public void setTurCita(Date turCita) {
        this.turCita = turCita;
    }

    public Integer getTurValor() {
        return turValor;
    }

    public void setTurValor(Integer turValor) {
        this.turValor = turValor;
    }

    public String getTurResponsable() {
        return turResponsable;
    }

    public void setTurResponsable(String turResponsable) {
        this.turResponsable = turResponsable;
    }

    public Integer getTurDa1() {
        return turDa1;
    }

    public void setTurDa1(Integer turDa1) {
        this.turDa1 = turDa1;
    }

    public Integer getTurDa2() {
        return turDa2;
    }

    public void setTurDa2(Integer turDa2) {
        this.turDa2 = turDa2;
    }

    public Integer getTurN() {
        return turN;
    }

    public void setTurN(Integer turN) {
        this.turN = turN;
    }

    public String getTurHorario() {
        return turHorario;
    }

    public void setTurHorario(String turHorario) {
        this.turHorario = turHorario;
    }

    public ProEspe getPreCod() {
        return preCod;
    }

    public void setPreCod(ProEspe preCod) {
        this.preCod = preCod;
    }

    public Paciente getPacCodigo() {
        return pacCodigo;
    }

    public void setPacCodigo(Paciente pacCodigo) {
        this.pacCodigo = pacCodigo;
    }

    public Collection<Diagnostico> getDiagnosticoCollection() {
        return diagnosticoCollection;
    }

    public void setDiagnosticoCollection(Collection<Diagnostico> diagnosticoCollection) {
        this.diagnosticoCollection = diagnosticoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (turCodigo != null ? turCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Turno)) {
            return false;
        }
        Turno other = (Turno) object;
        if ((this.turCodigo == null && other.turCodigo != null) || (this.turCodigo != null && !this.turCodigo.equals(other.turCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "escr.persistencia.Turno[turCodigo=" + turCodigo + "]";
    }

}
